﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SyndicateBusiness.Classes;

namespace BigLotterySyndicate.Secured.Users.Controls
{
    public partial class UserDetails : Base
    {
        public enum Tab
        {
            General = 1,
            Draws = 2,
            History = 3
        }

        protected Tab SelectedTab
        {
            get
            {
                return (Tab)Utilities.StringToInt(this.Request["Tab"], 1);
            }
        }

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            if (DesignMode)
                return;                      

            View activeView = null;

            switch (this.SelectedTab)
            {
                default:
                case Tab.General:
                    activeView = Tab1;
                    break;
                case Tab.Draws:
                    activeView = Tab2;
                    break;
                case Tab.History:
                    activeView = Tab3;
                    break;
                  
            }

            if (activeView != null)
            {
                MultiViewDetails.SetActiveView(activeView);
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Visible)
                return;
        }

        protected string PrintClassIfSelected(Tab tab, string cssClass)
        {
            return (tab == this.SelectedTab ? cssClass : "");
        }
    }
}